﻿using System;
using System.ComponentModel;
using Slippor.Common.PluginFramework;
using Slippor.Douban.Radio.Handler;
using System.Threading;

namespace AutoFavHandlerPlugin
{
    [DisplayName("Auto Make Fav")]
    [Description("在歌曲播放指定时间后，自动将其设为\"我喜欢\"（启用或修改设置后，下一歌曲有效。）")]
    [PluginCategory(PluginCategory.Handler)]
    [Author("拖鞋不脱", "http://slippor.blogbus.com/")]
    [Version(typeof(AutoFavVersion), "1.2.0.0")]
    [Config(typeof(AutoFavConfig))]
    public class AutoFavHandlerPlugin : HandlerPlugin
    {
        private readonly AutoFavHandler _autoFaveHandler;
        protected override IHandler Handler
        {
            get { return _autoFaveHandler; }
        }

        public AutoFavHandlerPlugin()
        {
            _autoFaveHandler = new AutoFavHandler(this);
        }

        public void SetInterval(TimeSpan interval)
        {
            _autoFaveHandler.Interval = interval;
        }
    }
}